stack: Fix a crash
authorMatthias Clasen <mclasen@redhat.com>
Thu, 14 Feb 2019 17:24:22 +0000 (12:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 14 Feb 2019 17:24:22 +0000 (12:24 -0500)
commit89d8ae043176183262536318ab8d2f06ab3a4ce1
treec4caddf3bf66156c0bcd380d15b7b9e3fd0f37ed
parentfb444919267892e34903b2c304e8c2b2b46bb154
stack: Fix a crash

We need to remove the weak pointer, as the stack switcher can
keep the list model alive beyond the stack. This was observed
to cause crashes:

==16870== Invalid write of size 8
==16870==    at 0x5168A4E: g_nullify_pointer (gutils.c:2284)
==16870==    by 0x522C500: weak_refs_notify (gobject.c:2791)
==16870==    by 0x50FE7BC: g_data_set_internal (gdataset.c:407)
==16870==    by 0x50FECA7: g_datalist_id_set_data_full (gdataset.c:670)
==16870==    by 0x5227EB4: g_object_real_dispose (gobject.c:1056)
==16870==    by 0x522D295: g_object_unref (gobject.c:3309)
==16870==    by 0x4AF849F: unset_stack (gtkstackswitcher.c:428)
==16870==    by 0x4AF892E: gtk_stack_switcher_dispose (gtkstackswitcher.c:527)
gtk/gtkstack.c